package edu.gatech.volt2.drdoommgt.domain;

import javax.persistence.Embeddable;

/**
 * This class represents an address.
 * 
 * @author Perron Jones
 */

@Embeddable
public class Address
{
	private String streetAddress;
	private String city;
	private String state;
	private String zipCode;
	
	/**
	 * This default constructor sets the metadata of the address to
	 * customized default values.
	 */
	public Address()
	{
		this.streetAddress= "N/A";
		this.city= "N/A";
		this.state= "N/A";
		this.zipCode= "N/A";
	}
	
	/**
	 * This constructor sets the metadata of the address to the information that
	 * is passed into it.
	 * 
	 * @param streetAddress1 the first line of the street address
	 * @param streetAddress2 the second line of the street address
	 * @param city the city of the street address
	 * @param state the state of the street address
	 * @param zipCode the zip code of the street address
	 */
	public Address(String streetAddress, String city, String state, String zipCode)
	{
		this.streetAddress= (streetAddress == null ? "N/A" : streetAddress);
		this.city= (city == null ? "N/A" : city);
		this.state= (state == null ? "N/A" : state);
		this.zipCode= (zipCode == null ? "N/A" : zipCode);
	}
	
	/**
	 * This method creates a string representation of the street address.
	 * 
	 * @return a string representation of the street address
	 */
	public String toString()
	{
		String addr= this.streetAddress + "\n" + this.city + ", " + this.state + " " + this.zipCode + "\n";
		
		return addr;
	}
	
	/**
	 * @param streetAddress1 the first line of the street address to set
	 */
	public void setStreetAddress(String streetAddress)
	{
		this.streetAddress = streetAddress;
	}
	
	/**
	 * @return the first line of the street address
	 */
	public String getStreetAddress()
	{
		return streetAddress;
	}
	
	
	/**
	 * @param city the city to set
	 */
	public void setCity(String city)
	{
		this.city = city;
	}
	
	/**
	 * @return the city
	 */
	public String getCity()
	{
		return city;
	}
	
	/**
	 * @param state the state to set
	 */
	public void setState(String state)
	{
		this.state = state;
	}
	
	/**
	 * @return the state
	 */
	public String getState()
	{
		return state;
	}
	
	/**
	 * @param zipCode the zip code to set
	 */
	public void setZipCode(String zipCode)
	{
		this.zipCode = zipCode;
	}
	/**
	 * @return the zip code
	 */
	
	public String getZipCode()
	{
		return zipCode;
	}
	
}
